package com.deyinet.bdcms.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Administrator on 2017/8/30 0030.
 */
@Entity
public class Device {
    private String sn;
    private String devicename;
    private String imei;
    private String imsi;
    private String devicemodel;
    private String deviceinfo;
    private Double lat;
    private Double lng;
    private String location;
    private Float upper;
    private Float lower;
    private Integer reportCycle;
    private Integer sampleCycle;
    private Timestamp createdate;
    private Integer ownerid;
    private Deviceowner deviceownerByOwnerid;

    @Id
    @Column(name = "sn", nullable = false, length = 20)
    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    @Basic
    @Column(name = "devicename", nullable = true, length = 50)
    public String getDevicename() {
        return devicename;
    }

    public void setDevicename(String devicename) {
        this.devicename = devicename;
    }

    @Basic
    @Column(name = "imei", nullable = true, length = 50)
    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    @Basic
    @Column(name = "imsi", nullable = true, length = 50)
    public String getImsi() {
        return imsi;
    }

    public void setImsi(String imsi) {
        this.imsi = imsi;
    }

    @Basic
    @Column(name = "deviceinfo", nullable = true, length = 50)
    public String getDeviceinfo() {
        return deviceinfo;
    }

    public void setDeviceinfo(String deviceinfo) {
        this.deviceinfo = deviceinfo;
    }

    @Basic
    @Column(name = "lat", nullable = true, precision = 6)
    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    @Basic
    @Column(name = "lng", nullable = true, precision = 6)
    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    @Basic
    @Column(name = "location", nullable = true, length = 100)
    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Basic
    @Column(name = "createdate", nullable = true)
    public Timestamp getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Timestamp createdate) {
        this.createdate = createdate;
    }

    @Basic
    @Column(name = "upper", nullable = true)
    public Float getUpper() {
        return upper;
    }

    public void setUpper(Float upper) {
        this.upper = upper;
    }

    @Basic
    @Column(name = "lower", nullable = true)
    public Float getLower() {
        return lower;
    }

    public void setLower(Float lower) {
        this.lower = lower;
    }

    @Basic
    @Column(name = "reportcycle")
    public Integer getReportCycle() {
        return reportCycle;
    }

    public void setReportCycle(Integer reportCycle) {
        this.reportCycle = reportCycle;
    }

    @Basic
    @Column(name = "samplecycle")
    public Integer getSampleCycle() {
        return sampleCycle;
    }

    public void setSampleCycle(Integer sampleCycle) {
        this.sampleCycle = sampleCycle;
    }

    @Basic
    @Column(name = "devicemodel")
    public String getDevicemodel() {
        return devicemodel;
    }

    public void setDevicemodel(String devicemodel) {
        this.devicemodel = devicemodel;
    }

    @Basic
    @Column(name = "ownerid", updatable = false, insertable = false)
    public Integer getOwnerid() {
        return ownerid;
    }

    public void setOwnerid(Integer ownerid) {
        this.ownerid = ownerid;
    }

    @ManyToOne
    @JoinColumn(name = "ownerid", referencedColumnName = "id", foreignKey = @ForeignKey(name = "device_ibfk_2"))
    public Deviceowner getDeviceownerByOwnerid() {
        return deviceownerByOwnerid;
    }

    public void setDeviceownerByOwnerid(Deviceowner deviceownerByOwnerid) {
        this.deviceownerByOwnerid = deviceownerByOwnerid;
    }


}
